package ldh.im.dto.codec.binery;

import io.netty.buffer.ByteBuf;
import ldh.im.dto.business.ExitReq;

public class ExitCodec extends AckToCodec<ExitReq> {

    @Override
    public void encode(ExitReq exitReq, ByteBuf byteBuf) {
        super.encode(exitReq, byteBuf);
        writeString(byteBuf, exitReq.getExitMessage());
    }

    @Override
    public void decode(ExitReq exitReq, ByteBuf byteBuf) {
        super.decode(exitReq, byteBuf);
        exitReq.setExitMessage(readString(byteBuf));
    }

    @Override
    public ExitReq create() {
        return new ExitReq();
    }
}
